<?php

namespace App\Http\Controllers;
use App\Video;
use App\App;
use Illuminate\Http\Request;

class HomeController extends Controller
{


    public function video(Request $request)
    {
        $id  = $request->id;
        $list = Video::with('image')->where('id',$id)->first();

        return view('home/video',['list'=>$list]);
    }


    public function index()
    {


        $app = App::orderBy('created_at','desc')->first();

        if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {

            return view('welcome',['url'=>1,'app'=>$app['file']]);

        }else{

            return view('welcome',['url'=>0,'app'=>$app['file']]);
        }

    }
}
